﻿using AutoMapper;
using B.MES.FLH.WarehouseManagement.Application;
using B.MES.FLH.WarehouseManagement.Application.Dtos.Made_UpArticles;
using B.MES.FLH.WarehouseManagement.Domain.Entity;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Standard;
using Yitter.IdGenerator;

namespace B.MES.FLH.WarehouseManagement.Controllers
{
    /// <summary>
    /// 成品控制器
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class Made_UpArticlesController : ControllerBase
    {
        private readonly IService service;

        public Made_UpArticlesController(IService service)
        {
            this.service = service;
        }
        /// <summary>
        /// 创建成品
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("CreateMade_UpArticlesModel")]
        public ApiResult<int> CreateMade_UpArticlesModel(CreateMade_UpArticlesModelInput input)
        {
            return service.CreateMade_UpArticlesModel(input);
        }
        /// <summary>
        /// 删除成品
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpPost("DeleteMade_UpArticlesModel")]
        public ApiResult<int> DeleteMade_UpArticlesModel(string id)
        {
            return service.DeleteMade_UpArticlesModel(id);
        }
        /// <summary>
        /// 获取成品列表
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        [HttpGet("GetMade_UpArticlesModel")]
        public ApiPaging<Made_UpArticlesModelOutput> GetMade_UpArticlesModel([FromQuery]PageMade_UpArticlesModel page)
        {
            return service.GetMade_UpArticlesModel(page);
        }
    }
}
